
from aiohttp import web

from .CacheService import CacheService
from .CivitaiService import CivitaiService
from .ConfigService import ConfigService
from .ImageService import ImageService
from .LoraService import LoraService

# 路由配置
routes = [
    web.post("/command/read-metadata", ImageService.read_metadata),
    web.get("/command/get-image", ImageService.get_image),
    web.post("/command/save-webp-image", ImageService.save_image_as_webp),
    web.get("/command/get-metadata", ImageService.get_metadata),
    web.get("/command/get-loras", LoraService.get_loras),
    web.get("/command/get-lora-json", LoraService.get_lora_json),
    web.get("/command/get-lora-metadata", LoraService.get_lora_metadata),
    web.post("/command/save-lora-config", LoraService.save_lora_config),
    web.post("/command/save-lora-image", LoraService.save_lora_image),
    web.post("/command/check-lora-all", LoraService.start_lora_check),
    web.post("/command/cache-image", CacheService.cache_image),
    web.post("/command/fetch-civitai-info", CivitaiService.fetch_civitai_info),
    web.post("/command/global-fetch-civitai-info", CivitaiService.start_batch_marvelous_check),
    web.get("/command/get-config-json", ConfigService.read_config),
    web.post("/command/save-config", ConfigService.save_config),
]